import {
    post,
    get,
    put,
    Delete,
    form
} from "@/axios/http.js";
import {
    basicApi
} from "@/api/index.js"
//模块数据
export default {
    namespaced: true,
    state: {},
    actions: {
        // 收藏的c错题本
        collectWrongQuestion({}, params) {
            return post(basicApi.home.collectWrongQuestion, params).then(res => {
                if (res.data.code == 200) {
                    return res.data.result
                } else {
                    this._vm.$message.error(res.data.msg)
                }
            });
        },
        // 收藏的试题
        collectQuestion({}, params) {
            return post(basicApi.home.collectQuestion, params).then(res => {
                if (res.data.code == 200) {
                    return res.data.result
                } else {
                    this._vm.$message.error(res.data.msg)
                }
            });
        },
        // 收藏的视频
        collectVideo({}, params) {
            return post(basicApi.home.collectVideo, params).then(res => {
                if (res.data.code == 200) {
                    return res.data.result
                } else {
                    this._vm.$message.error(res.data.msg)
                }
            });
        },
        // 学习过的视频
        studyVideo({}, params) {
            return post(basicApi.home.studyVideo, params).then(res => {
                if (res.data.code == 200) {
                    return res.data.result
                } else {
                    this._vm.$message.error(res.data.msg)
                }
            });
        },
        // 绑定邮箱
        bindEmail({}, params) {
            return get(basicApi.home.bindEmail, params).then(res => {
                if (res.data.code == 200) {
                    return res
                } else {
                    this._vm.$message.error(res.data.msg)
                }
            });
        },
        // 绑定邮箱信息
        loadBindInfo({}, params) {
            return get(basicApi.home.loadBindInfo, params).then(res => {
                if (res.data.code == 200) {
                    return res.data.result
                } else {
                    this._vm.$message.error(res.data.msg)
                }
            });
        },
        // 个性签名
        signature({}, params) {
            return get(basicApi.home.signature, params).then(res => {
                if (res.data.code == 200) {
                    return res.data.result
                } else {
                    this._vm.$message.error(res.data.msg)
                }
            });
        },
        // 我的错题
        getWrongQuestion({}, params) {
            return get(basicApi.home.getWrongQuestion, params).then(res => {
                if (res.data.code == 200) {
                    return res.data.result
                } else {
                    this._vm.$message.error(res.data.msg)
                }
            });
        },
        // 我做过的试题
        getQuestionsDone({}, params) {
            return get(basicApi.home.getQuestionsDone, params).then(res => {
                if (res.data.code == 200) {
                    return res.data.result
                } else {
                    this._vm.$message.error(res.data.msg)
                }
            });
        },
        // 我的收藏
        getCollectArticles({}, params) {
            return get(basicApi.home.getCollectArticles, params).then(res => {
                if (res.data.code == 200) {
                    return res.data.result
                } else {
                    this._vm.$message.error(res.data.msg)
                }
            });
        },
        // 首页手搜索接口
        homeSearch({}, params) {
            return post(basicApi.home.homeSearch, params).then(res => {
                if (res.data.code == 200) {
                    return res.data.result
                } else {
                    this._vm.$message.error(res.data.msg)
                }
            });
        },
        // 个人主页-文章-相册-资源的统计信息
        extStatistic({}, params) {
            return get(basicApi.home.extStatistic, params).then(res => {
                if (res.data.code == 200) {
                    return res.data.result
                } else {
                    this._vm.$message.error(res.data.msg)
                }
            });
        },
        // 优秀空间
        homeExcellent({}, params) {
            return post(basicApi.home.homeExcellent, params);
        },
        // 个人&&机构空间&&最新文章&&最新文章
        getZoneList({}, params) {
            return get(basicApi.home.zoneList, params);
        },
        // 首页按需查询系统用户
        homeZoneUserList({}, params) {
            return get(basicApi.home.homeZoneUserList, params);
        },

        // 个人空间赛选条件选择框
        getSelectStage({}, params) {
            return get(basicApi.home.selectStage, params);
        },
    },
    mutations: {},
};